home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / PASCSRC.ZIP / CONSTANT.PAS < prev    next >
Pascal/Delphi Source File  |  1988-01-15  |  940b  |  28 lines

  1.                                 (* Chapter 6 - Program 4 *)
  2. program Example_Of_Constants;
  3.  
  4. const  Max_Size = 12; (* Pascal assumes this is a byte type, but it
  5.                          can be used as an integer also *)
  6.        Index_Start   : integer = 49; (* This is a typed constant *)
  7.        Check_It_Out  : boolean = TRUE; (* Another typed constant *)
  8.  
  9. type Bigarray  = array[1..Max_Size] of integer;
  10.      Chararray = array[1..Max_Size] of char;
  11.  
  12. var  Airplane   : Bigarray;
  13.      Seaplane   : Bigarray;
  14.      Helicopter : Bigarray;
  15.      Cows       : Chararray;
  16.      Horses     : Chararray;
  17.      Index      : integer;
  18.  
  19. begin  (* main program *)
  20.    for Index := 1 to Max_Size do begin
  21.       Airplane[Index] := Index*2;
  22.       Seaplane[Index] := Index*3 + 7;
  23.       Helicopter[Max_Size - Index + 1] := Index + Airplane[Index];
  24.       Horses[Index] := 'X';
  25.       Cows[Index] := 'R';
  26.    end;
  27. end.  (* of main program *)
  28.